#include <stdio.h>

int data[5];
int n, m, k;

int dp[21][21];
int prev[21][21];
int k1[21][21], k2[21][21], k3[21][21], k4[21][21];

int dfs (int x, int y)
{
	if (x == 0 || y == 0)
		return 1;
	if (x > y)
		return dfs(y, x);
	if (dp[x][y] != -1)
		return dp[x][y];
	dp[x][y] = 0;
	for (int i = 1; i <= x - i; i ++)
		if (dfs(i, y) && dfs(x - i, y))
		{
//			printf("%d %d\n", x, y);
			dp[x][y] = 1;
			prev[x][y] = 1;
			k1[x][y] = i;
			return 1;
		}
	for (int i = 1; i <= y - i; i ++)
		if (dfs(x, i) && dfs(x, y - i))
		{
//			printf("%d %d\n", x, y);
			dp[x][y] = 1;
			prev[x][y] = 2;
			k1[x][y] = i;
			return 1;
		}
	for (int i = 0; i < x; i ++)
		for (int j = 0; j < y; j ++)
			for (int ii = i; ii < x; ii ++)
				for (int jj = j; jj < y; jj ++)
					if (dfs(i, jj + 1) && dfs(ii + 1, y - jj - 1) && dfs (x - i, j) && dfs (x - ii - 1, y - j) && dfs(ii - i + 1, jj - j + 1))
					{
//			printf("%d %d\n", x, y);
						dp[x][y] = 1;
						prev[x][y] = 3;
//						printf("%d %d %d %d\n", i, j, ii, jj);
//						printf("%d %d %d %d %d\n", dfs(i, jj + 1) , dfs(ii, n - jj - 1) , dfs (n - i, j) , dfs (n - ii - 1, n - j) , dfs(ii - i + 1, jj - j + 1));
						k1[x][y] = i;
						k2[x][y] = j;
						k3[x][y] = ii;
						k4[x][y] = jj;
						return 1;
					}
	return 0;
}

int ct;

void dfsdraw (int n, int m, int* buf, int line)
{
	if (n == 0 || m == 0)
		return;
	if (n > m)
	{
		int *buf2 = new int[n * m];
		dfsdraw(m, n, buf2, n);
		for (int i = 0; i < n; i ++)
			for (int j = 0; j < m; j ++)
				buf[i * line + j] = buf2[j * n + i];
		delete buf2;
		return;
	}
	if (prev[n][m] == 0)
	{
		for (int i = 0; i < n; i ++)
			for (int j = 0; j < m; j ++)
				buf[i * line + j] = ct;
		ct ++;
	}
	else if (prev[n][m] == 1)
	{
		dfsdraw (k1[n][m], m, buf, line);
		dfsdraw (n - k1[n][m], m, buf + line * k1[n][m], line);
	}
	else if (prev[n][m] == 2)
	{
		dfsdraw (n, k1[n][m], buf, line);
		dfsdraw (n, m - k1[n][m], buf + k1[n][m], line);
	}
	else if (prev[n][m] == 3)
	{
		int i, j, ii, jj;

		i = k1[n][m];
		j = k2[n][m];
		ii = k3[n][m];
		jj = k4[n][m];
//		printf("%d %d %d %d\n", i, j, ii, jj);
		//if (dfs(i, jj + 1) && dfs(ii + 1, n - jj - 1) && dfs (n - i, j) && dfs (n - ii - 1, n - j) && dfs(ii - i + 1, jj - j + 1))
		dfsdraw (i, jj + 1, buf, line);
		dfsdraw (ii + 1, m - jj - 1, buf + jj + 1, line);
		dfsdraw (n - i, j, buf + line * i, line);
		dfsdraw (n - ii - 1, m - j, buf + line * (ii + 1) + j, line);
		dfsdraw (ii - i + 1, jj - j + 1, buf + line * i + j, line);
	}
	else
	{
		printf("Ruaaaaru\n");
	}
}

int buf[1000000];

char outbuf[21][21];

int main ()
{
	scanf("%d%d%d", &n, &m, &k);
	for (int i = 0; i < k; i ++)
		scanf("%d", data + i);
	for (int i = 0; i <= 20; i ++)
		for (int j = 0; j <= 20; j ++)
			dp[i][j] = -1;
	for (int i = 0; i < k; i ++)
	{
		dp[1][data[i]] = 1;
		prev[1][data[i]] = 0;
	}
	ct = 0;
	if (dfs(n, m))
	{
		printf("YES\n");
		dfsdraw (n, m, buf, m);
		
		for (int i = 0; i < n; i ++)
			for (int j = 0; j < m; j ++)
				outbuf[i][j] = '!';

		for (int i = 0; i < n; i ++)
			for (int j = 0; j < m; j ++)
				if (outbuf[i][j] == '!')
				{
					int used[26];

					for (int ii = 0; ii < 26; ii ++)
						used[ii] = 0;

					for (int ii = 0; ii < n; ii ++)
						for (int jj = 0; jj < m; jj ++)
							if (buf[ii * m + jj] == buf[i * m + j])
							{
								if (ii - 1 >= 0 && outbuf[ii - 1][jj] != '!')
									used[outbuf[ii - 1][jj] - 'a'] = 1;
								if (jj - 1 >= 0 && outbuf[ii][jj - 1] != '!')
									used[outbuf[ii][jj - 1] - 'a'] = 1;
								if (ii + 1 < n && outbuf[ii + 1][jj] != '!')
									used[outbuf[ii + 1][jj] - 'a'] = 1;
								if (jj + 1 < m && outbuf[ii][jj + 1] != '!')
									used[outbuf[ii][jj + 1] - 'a'] = 1;
							}
					int kk = 0;
					while (kk < 26 && used[kk])
						kk ++;
					if (kk == 26)
						while (1);

					for (int ii = 0; ii < n; ii ++)
						for (int jj = 0; jj < m; jj ++)
							if (buf[ii * m + jj] == buf[i * m + j])
							{
								outbuf[ii][jj] = 'a' + kk;
							}
				}

		for (int i = 0; i < n; i ++)
		{
			for (int j = 0; j < m; j ++)
				printf("%c", outbuf[i][j]);
			printf("\n");
		}
	}
	else
	{
		printf("NO\n");
	}

	return 0;
}